
<template>
    <div class="contentBox">
        <img class="banner" src="../../../assets/Image/dailyBanner.png" alt="">
        <div class="itemBox" v-for="item in data" :key="item.id">
            <div class="topBox">
                <img class="spBanner" :src="item.image" alt="">
                <div class="lable">月销{{item.sales}}件</div>
            </div>
            <div class="ItemcontentBox">
                <div class="title">{{ item.product_name }}</div>
                <div class="Price">
                    <div class="yesP"><span class="￥">￥</span>{{ item.price }}</div>
                    <div class="noP"><span style="color:#999999" class="￥">￥</span>{{ item.ot_price }}</div>
                </div>
            </div>
        </div>
    </div>
</template>
  
<script lang="ts" setup>
import { defineProps } from "vue";
const props = defineProps({
    data: {
        type: Array as () => Array<any>, //(string也可以是其他你自定义的接口)
        required: true,
        default: () => []
    }
});
console.log('====================================');
console.log(props);
console.log('====================================');


</script>
  
  
<style scoped lang="less">
.contentBox {
    max-width: 1920px;
    margin: 0 auto;
    // background: #f5f5f5;
    height: 1638px;
    background-size: 100% 100%;
    padding: 52px 290px 190px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    position: relative;

    .itemBox {
        width: 210px;
        height: 334px;
        background: #FFFFFF;
        z-index: 100;
        margin-bottom: 20px;

        .topBox {
            width: 210px;
            height: 210px;
            position: relative;

            .spBanner {
                position: absolute;
                top: 0;
                width: 100%;
                height: 100%;
            }

            .lable {
                position: absolute;
                left: 0;
                bottom: 0;
                padding: 5px 28px 5px 10px;
                font-size: 16px;
                background: #DD2131;
                border-radius: 0px 18px 0px 0px;
                opacity: 0.3;
                font-family: PingFang SC-Medium, PingFang SC;
                font-weight: 500;
                color: #FFFFFF;
                z-index: 10;
            }
        }

        .ItemcontentBox {
            padding: 10px;
            box-sizing: border-box;
            // display: flex;
            

            .title {
                height: 40px;
                width: 170px;
                font-size: 20px;
                font-family: PingFang SC-Medium, PingFang SC;
                font-weight: 500;
                color: #333333;
                line-height: 40px;
                overflow: hidden; //超出隐藏
                white-space: nowrap; //不折行
                text-overflow: ellipsis;
            }

            .Price {
                width: 100%;
                height: 30px;
                display: flex;
                line-height: 40px;
                margin-top: 25px;

                .￥ {
                    font-size: 16px;
                    font-family: PingFang SC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #DD2131;
                }

                .yesP {
                    font-size: 22px;
                    font-family: PingFang SC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #DD2131;
                    margin-right: 10px;
                }

                .noP {
                    font-size: 19px;
                    font-family: PingFang SC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #999999;
                    text-decoration:line-through;
                }
            }
        }
    }

    .banner {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}
</style>
  